/*
 * SPC.cpp
 *
 *  Created on: 21.01.2014
 *      Author: Stefan
 */

#include "SPC.h"
#include <iostream>

using namespace std;

SPC::SPC(int iSet, int iNodeNumber, int iDOFs, float dDisplacement) {
	this->iSet = iSet;
	this->iNodeNumber = iNodeNumber;
	this->iDOFs = iDOFs;
	this->dDisplacement = dDisplacement;

	/*cout << "SPC created!" << endl;
	for(int i=1;i<6;i++){
		if(dofConstrained(i))
			cout << "DOF " << i << " constrained." << endl;
	}*/
}

bool SPC::dofConstrained(int iDofOfInterest) {
	if ((iDOFs % 10) == iDofOfInterest || (iDOFs / 10 % 10) == iDofOfInterest || (iDOFs / 100 % 10) == iDofOfInterest || (iDOFs / 1000 % 10) == iDofOfInterest || (iDOFs / 10000 % 10) == iDofOfInterest
			|| (iDOFs / 100000 % 10) == iDofOfInterest)
		return true;
	else
		return false;
}
